﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

using Pg.BioMedics.SDR.Entities;
using Pg.BioMedics.SDR.Entities.Codes;

namespace Pg.BioMedics.SDR.Services
{
    /// <summary>
    /// Provides static routines supporting document processing
    /// </summary>
    internal static class DocumentHelper
    {
        #region Static methods

        /// <summary>
        /// Returns document type basing on it's content
        /// </summary>
        /// <param name="content">document's content</param>
        /// <returns>Document type code</returns>
        internal static string ResolveDocumentType(Content content)
        {
            if (content.TypeCode == ContentTypeCodes.WAV)
                return DocumentTypeCodes.Audio;
            else if (content.TypeCode == ContentTypeCodes.JPEG)
                return DocumentTypeCodes.Image;
            else if (content.TypeCode == ContentTypeCodes.TEXT)
                return DocumentTypeCodes.Text;
            else
                return DocumentTypeCodes.Other;
        }

        #endregion
    }
}
